<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateFeishuCallingCardFranchiseesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('feishu_calling_card_franchisees', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('uid')->unique('uid')->comment('加盟商在rms的user.id');
            $table->unsignedInteger('backgroundId')->comment('当前背景id')->default(0);
            $table->string('position', 50)->comment('职位，默认夸父合伙人')->default('');
            $table->string('wechatQrcode', 128)->comment('微信二维码url，公有oss的path')->default('');
            $table->unsignedTinyInteger('showPosition')->comment('是否显示职位')->default(1);
            $table->string('wechatUrl', 128)->comment('海报url，公有oss的path')->default('');
            $table->string('wechatPreviewUrl', 128)->comment('海报覆盖图层后预览url，公有oss的path')->default('');
            $table->string('backgroundUrl', 128)->comment('自定义的背景图，公有oss的path')->default('');
            $table->unsignedInteger('prizeNum')->comment('累计奖励金额')->default(0);
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '加盟名片 - 加盟商信息表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('feishu_calling_card_franchisees');
    }
}
